package com.zhentao.model.common.dtos;

import lombok.Data;

import java.io.Serializable;

/**
 * @ClassName: Result
 * @Author: 振涛教育_Q  权限结果返回集专用
 * @Date: 2024/12/27 14:41
 */
@Data
public class PermissionResult<R> implements Serializable {
    private Integer code;
    private String msg;
    private R data;

    public PermissionResult() {}

    public PermissionResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public PermissionResult(Integer code, String msg, R data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static PermissionResult OK(Integer code , String msg){
        PermissionResult result = new PermissionResult(code,msg);
        return result;
    }

    public static <R> PermissionResult OK(Integer code, String msg, R data){
        PermissionResult result = new PermissionResult(code,msg,data);
        return result;
    }

    public static PermissionResult ERROR(Integer code , String msg){
        PermissionResult result = new PermissionResult(code,msg);
        return result;
    }

    public static <R> PermissionResult ERROR(Integer code, String msg, R data){
        PermissionResult result = new PermissionResult(code,msg,data);
        return result;
    }




}
